﻿#pragma once
#include "AsGraphicsObject.h"

__AS_JY(Update 2023.1.7)
namespace AsGraphicsNamespace {

	AS_MEMBER_CLASS_DECLARATION(AsGraphicsGeometricMeasurer);

	class AS_GRAPHICS_API AsGraphicsGeometricMeasurer : public AsGraphicsObject, public AsBinder<AsGraphicsGeometricMeasurer> {
		Q_OBJECT

	public:
		explicit AsGraphicsGeometricMeasurer(QObject* parent = nullptr);
		explicit AsGraphicsGeometricMeasurer(AsGraphics* graphics, QObject* parent = nullptr);
		~AsGraphicsGeometricMeasurer();

	private:
		AS_MEMBER_CLASS(AsGraphicsGeometricMeasurer)* mp;

	public:
		void create(AsGraphics* graphics, QObject* parent = nullptr);
		void destroy();

	public:
		int getStepFlag();
		bool isValidDatumLength();
		bool isValidDistanceToDatum();
		bool isValidAngleWidthDatum();
		double getDatumLength();
		double getDistanceToDatum();
		double getAngleWidthDatum();

	public:
		void setTriggerButton(Qt::MouseButton b);
		void setLineColor(const QColor& commited, const QColor& dashed);
		void setLineThickness(int thickness, bool keepThickness = true);

	signals:
		void sigMousePosChanged(QPointF);

	};

	typedef AsGraphicsGeometricMeasurer GeometricMeasurer;

};

namespace AG = AsGraphicsNamespace;
